using System.Collections.Generic;
using System.Diagnostics;

namespace NConfigGenerator
{
    [DebuggerDisplay("{Name} [{Children.Count} children] (Collection)")]
    public sealed class CollectionConfigNode : ConfigNode
    {
        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private ConfigNode _child;

        public CollectionConfigNode(ConfigNode parent, string name)
            : base(parent, name)
        {
        }

        public ConfigNode Child
        {
            [DebuggerStepThrough]
            get { return _child; }
            [DebuggerStepThrough]
            set { _child = value; }
        }

        public override IEnumerable<ConfigNode> AllChildren
        {
            get { yield return _child; }
        }
    }
}